# (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)

AGENT_DEFAULT_METRICS = [
    'cilium.agent.api_process_time.seconds.count',
    'cilium.agent.api_process_time.seconds.sum',
    'cilium.api_limiter.adjustment_factor',
    'cilium.api_limiter.processed_requests.total',
    'cilium.api_limiter.processing_duration.seconds',
    'cilium.api_limiter.rate_limit',
    'cilium.api_limiter.requests_in_flight',
    'cilium.api_limiter.wait_duration.seconds',
    'cilium.agent.bootstrap.seconds.count',
    'cilium.agent.bootstrap.seconds.sum',
    'cilium.controllers.failing.count',
    'cilium.controllers.runs_duration.seconds.count',
    'cilium.controllers.runs_duration.seconds.sum',
    'cilium.endpoint.count',
    'cilium.endpoint.regeneration_time_stats.seconds.count',
    'cilium.endpoint.regeneration_time_stats.seconds.sum',
    'cilium.endpoint.state',
    'cilium.event_timestamp',
    'cilium.identity.count',
    'cilium.ip_addresses.count',
    'cilium.k8s_client.api_latency_time.seconds.count',
    'cilium.k8s_client.api_latency_time.seconds.sum',
    'cilium.nodes.managed.total',
    'cilium.policy.count',
    'cilium.policy.endpoint_enforcement_status',
    'cilium.policy.max_revision',
    'cilium.policy.regeneration_time_stats.seconds.count',
    'cilium.policy.regeneration_time_stats.seconds.sum',
    'cilium.process.max_fds',
    'cilium.process.open_fds',
    'cilium.process.resident_memory.bytes',
    'cilium.process.start_time.seconds',
    'cilium.process.virtual_memory.bytes',
    'cilium.process.virtual_memory.max.bytes',
    'cilium.triggers_policy.update_folds',
    'cilium.unreachable.health_endpoints',
    'cilium.unreachable.nodes',
    'cilium.kvstore.quorum_errors.total',
]

AGENT_METRICS_1_14 = [
    # E2E not updated yet to 1.14+ of Cilium
    'cilium.cidrgroup.policies',
    'cilium.k8s_client.rate_limiter_duration.seconds.count',
    'cilium.k8s_client.rate_limiter_duration.seconds.sum',
    'cilium.policy.change.total',
    'cilium.services.events.total',
]

ADDL_AGENT_METRICS = [
    'cilium.triggers_policy.update_call_duration.seconds.count',
    'cilium.triggers_policy.update_call_duration.seconds.sum',
    'cilium.triggers_policy.update.total',
    'cilium.subprocess.start.total',
    'cilium.process.cpu.seconds.total',
    'cilium.policy.regeneration.total',
    'cilium.proxy.redirects',
    'cilium.proxy.upstream_reply.seconds.count',
    'cilium.proxy.upstream_reply.seconds.sum',
    'cilium.proxy.datapath.update_timeout.total',
    'cilium.policy.l7.total',
    'cilium.policy.l7_denied.total',
    'cilium.policy.l7_forwarded.total',
    'cilium.policy.l7_parse_errors.total',
    'cilium.policy.l7_received.total',
    'cilium.policy.import_errors.count',
    'cilium.nodes.all_datapath_validations.total',
    'cilium.nodes.all_events_received.total',
    'cilium.kubernetes.events_received.total',
    'cilium.kubernetes.events.total',
    'cilium.k8s_client.api_calls.count',
    'cilium.ipam.events.total',
    'cilium.fqdn.gc_deletions.total',
    'cilium.fqdn.active_names',
    'cilium.fqdn.active_ips',
    'cilium.fqdn.alive_zombie_connections',
    'cilium.forward_bytes.total',
    'cilium.forward_count.total',
    'cilium.errors_warning.total',
    'cilium.drop_bytes.total',
    'cilium.drop_count.total',
    'cilium.datapath.conntrack_gc.key_fallbacks.total',
    'cilium.datapath.conntrack_gc.runs.total',
    'cilium.controllers.runs.total',
    'cilium.bpf.map_ops.total',
    'cilium.datapath.conntrack_gc.duration.seconds.count',
    'cilium.datapath.conntrack_gc.duration.seconds.sum',
    'cilium.datapath.conntrack_gc.entries',
    'cilium.datapath.errors.total',
    'cilium.k8s_client.api_calls.count',
    'cilium.identity.count',
    'cilium.policy.count',
    'cilium.policy.import_errors.count',
    'cilium.bpf.map_pressure',
    'cilium.bpf.maps.virtual_memory.max.bytes',
    'cilium.bpf.progs.virtual_memory.max.bytes',
    'cilium.datapath.conntrack_dump.resets.total',
    'cilium.ipcache.errors.total',
    'cilium.k8s_event.lag.seconds',
    'cilium.k8s_terminating.endpoints_events.total',
    'cilium.policy.implementation_delay.count',
    'cilium.policy.implementation_delay.sum',
    'cilium.endpoint.regenerations.total',
    'cilium.kvstore.sync_queue_size',
    'cilium.kvstore.initial_sync_completed',
]

OPERATOR_METRICS = [
    'cilium.operator.process.cpu.seconds',
    'cilium.operator.process.max_fds',
    'cilium.operator.process.open_fds',
    'cilium.operator.process.resident_memory.bytes',
    'cilium.operator.process.start_time.seconds',
    'cilium.operator.process.virtual_memory.bytes',
    'cilium.operator.process.virtual_memory_max.bytes',
]

OPERATOR_METRICS_1_14 = [
    # E2E not updated yet to 1.14+ of Cilium
    'cilium.operator.ipam.allocation.duration.seconds.count',
    'cilium.operator.ipam.allocation.duration.seconds.sum',
    'cilium.operator.ipam.available_interfaces',
    'cilium.operator.ipam.available_ips',
    'cilium.operator.ipam.ip_release_ops',
    'cilium.operator.ipam.needed_ips',
    'cilium.operator.ipam.release.duration.seconds.sum',
    'cilium.operator.ipam.release.duration.seconds.count',
    'cilium.operator.ipam.used_ips',
]

OPERATOR_AWS_METRICS = [
    'cilium.operator.eni.k8s_sync.duration.seconds.count',
    'cilium.operator.eni.aws_api_duration.seconds.count',
    'cilium.operator.eni.deficit_resolver.latency.seconds.count',
    'cilium.operator.eni.k8s_sync.latency.seconds.sum',
    'cilium.operator.eni.deficit_resolver.latency.seconds.sum',
    'cilium.operator.eni.deficit_resolver.duration.seconds.sum',
    'cilium.operator.eni.deficit_resolver.queued.total',
    'cilium.operator.eni.ips.total',
    'cilium.operator.eni.k8s_sync.folds',
    'cilium.operator.eni.k8s_sync.duration.seconds.sum',
    'cilium.operator.eni.k8s_sync.latency.seconds.count',
    'cilium.operator.eni.available',
    'cilium.operator.eni.ec2_resync.latency.seconds.count',
    'cilium.operator.eni.interface_creation_ops',
    'cilium.operator.eni.ec2_resync.folds',
    'cilium.operator.eni.ec2_resync.duration.seconds.count',
    'cilium.operator.eni.deficit_resolver.duration.seconds.count',
    'cilium.operator.eni.deficit_resolver.folds',
    'cilium.operator.eni.ec2_resync.duration.seconds.sum',
    'cilium.operator.eni.nodes.total',
    'cilium.operator.eni.ec2_resync.latency.seconds.sum',
    'cilium.operator.eni.aws_api_duration.seconds.sum',
    'cilium.operator.eni.ec2_resync.queued.total',
    'cilium.operator.eni.available.ips_per_subnet',
    'cilium.operator.eni.k8s_sync.queued.total',
    'cilium.operator.eni.resync.total',
    'cilium.operator.ces.sync_errors.total',
    'cilium.operator.ces.queueing_delay.seconds.count',
    'cilium.operator.ces.queueing_delay.seconds.sum',
    'cilium.operator.ec2.api.duration.seconds.count',
    'cilium.operator.ec2.api.duration.seconds.sum',
    'cilium.operator.identity_gc.entries',
    'cilium.operator.identity_gc.runs',
    'cilium.operator.ipam.allocation_ops',
    'cilium.operator.ipam.available',
    'cilium.operator.ipam.available.ips_per_subnet',
    'cilium.operator.ipam.deficit_resolver.queued.total',
    'cilium.operator.ipam.deficit_resolver.duration.seconds.count',
    'cilium.operator.ipam.deficit_resolver.duration.seconds.sum',
    'cilium.operator.ipam.deficit_resolver.folds',
    'cilium.operator.ipam.deficit_resolver.latency.seconds.count',
    'cilium.operator.ipam.deficit_resolver.latency.seconds.sum',
    'cilium.operator.ipam.interface_creation_ops',
    'cilium.operator.ipam.ips',
    'cilium.operator.ipam.k8s_sync.queued.total',
    'cilium.operator.ipam.k8s_sync.duration.seconds.count',
    'cilium.operator.ipam.k8s_sync.duration.seconds.sum',
    'cilium.operator.ipam.k8s_sync.folds',
    'cilium.operator.ipam.k8s_sync.latency.seconds.count',
    'cilium.operator.ipam.k8s_sync.latency.seconds.sum',
    'cilium.operator.ipam.nodes',
    'cilium.operator.ipam.release_ops',
    'cilium.operator.ipam.resync.queued.total',
    'cilium.operator.ipam.resync.total',
    'cilium.operator.ipam.resync.duration.seconds.count',
    'cilium.operator.ipam.resync.duration.seconds.sum',
    'cilium.operator.ipam.resync.folds',
    'cilium.operator.ipam.resync.latency.seconds.count',
    'cilium.operator.ipam.resync.latency.seconds.sum',
    'cilium.operator.num_ceps_per_ces.count',
    'cilium.operator.num_ceps_per_ces.sum',
    'cilium.operator.ipam.empty_interface_slots',
    'cilium.operator.ipam.interface_candidates',
    'cilium.operator.ipam.ip_allocation_ops',
]

OPERATOR_AZURE_METRICS = [
    'cilium.operator.azure.api.duration.seconds.count',
    'cilium.operator.azure.api.duration.seconds.sum',
    'cilium.operator.azure.api.rate_limit.duration.seconds.count',
    'cilium.operator.azure.api.rate_limit.duration.seconds.sum',
]
